home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-01-19 | 2.7 KB | 109 lines | [TEXT/MMCC] |
- //
- // CTelnetTerminal.h
- //
- // MiniTelnet application
- // Telnet session document
- // PowerPlant version
- //
- // Copyright © 1993-95, FrostByte Design / Eric Scouten
- //
-
- #pragma once
-
- #include <LSingleDoc.h>
- #include "CTelnetInterp.h"
-
- #include "MiniTelnet.const.h"
-
- class CTerminalPane;
-
-
-
- //***********************************************************
-
- class CTelnetTerminal : public LSingleDoc, public CTelnetInterp {
-
- // This class implements the behavior of a terminal connected to Telnet. It uses the
- // CTerminalPane class to draw the terminal screen. It handles all user events (such as
- // key-downs) and interacts with CTCPStream to process them.
-
- // Some debugging methods are included so that the “behind-the-scenes” negotiation of
- // Telnet can be viewed on-screen.
-
- public:
- CTelnetTerminal(LCommander* inSuper,
- unsigned short theDefaultPort,
- unsigned long recBufferSize = recReceiveSize,
- unsigned short autoReceiveSize = recAutoRecSize,
- unsigned short autoReceiveNum = recAutoRecNum,
- Boolean doUseCName = true);
-
- // creating new sessions
-
- virtual void NewSession(TelnetSettingsRec& inSettings);
-
-
- // closing windows & sessions
-
- virtual void AttemptClose(Boolean inRecordIt);
- virtual void RemoteClose();
-
- // window titling
-
- virtual void SetWindowTitle(Str255 newTitle);
- virtual void GetFileName(Str255 theName);
-
- // command/event handling
-
- virtual Boolean ObeyCommand(CommandT inCommand, void* ioParam);
- virtual void FindCommandStatus(CommandT inCommand,
- Boolean& outEnabled, Boolean& outUsesMark,
- Char16& outMark, Str255 outName);
- virtual Boolean HandleKeyPress(const EventRecord& inKeyEvent);
-
- // data handling methods
-
- virtual void HandleNVTChar(uchar theChar);
- virtual void HandleNVTLine(char* theLine);
-
- // Telnet command handling
-
- virtual void ReceivedDo(uchar theOption);
- virtual void ReceivedAYT();
- virtual void ReceivedEC();
- virtual void ReceivedEL();
- virtual void ReceivedSE();
-
- // Telnet option handling
-
- virtual void OptionTerminalType();
-
- // terminal emulation handling
-
- virtual void GetTerminalName(short termIndex, char* termStr);
-
- // debugging methods
- // These methods were useful to me in debugging the implementation of various Telnet
- // options. They are enabled by the “Show debugging codes” option of the settings dialog.
-
- virtual void PrintDebugStr(char* theDebugStr);
- virtual void PrintDebugCharNum(char theChar, char leftBracket, char rightBracket);
-
-
- // data members
-
- protected:
- CTerminalPane* itsTerminal; // terminal who displays our I/O
- TelnetSettingsRec mSettings; // settings record
- short itsTermMode; // which terminal emulation?
-
- // Telnet window description
-
- enum {
- PPobTelnet = 1026
- // pane descriptions to follow later…
- };
-
-
- };
-